public class Course {
    private String courseName;
    private String courseId;
    private int credits;

    // 构造方法
    public Course(String courseName, String courseId, int credits) {
        this.courseName = courseName;
        this.courseId = courseId;
        this.credits = credits;
    }

    // 访问器方法
    public String getCourseName() {
        return courseName;
    }

    public String getCourseId() {
        return courseId;
    }

    public int getCredits() {
        return credits;
    }

    // 修改器方法
    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }

    public void setCredits(int credits) {
        this.credits = credits;
    }

    // 显示课程信息
    public void displayCourseInfo() {
        System.out.println("课程名称: " + courseName);
        System.out.println("课程编号: " + courseId);
        System.out.println("学分: " + credits);
    }
}
